home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-19 / quikcmd3.zip / ZOOMBACK.LSP < prev   
Lisp/Scheme  |  1992-07-05  |  4KB  |  110 lines

  1. ;  ZOOMBACK.LSP
  2.  ;
  3.  ;                         QUICK COMMAND Release 3.0
  4.  ;                   ZOOMBACK.LSP is a module of QUICK COMMAND
  5. ;                       Copyright 1989, 90, 92 Dan Jincks
  6.  ;
  7.  ;
  8. ;              This is SHAREWARE, it is NOT Public Domain software.
  9.  ;
  10.  ;              This code or any part of this code may not be reproduced
  11.  ;              in any publication without prior written permission.
  12.  ;
  13.  ;              Printed copy of this code or any part of this code may not
  14.  ;              be distributed without prior written permission.
  15.  ;
  16.  ;              Printed copy may only be made for reference purposes by
  17.  ;              the end user.
  18.  ;
  19.  ;
  20.  ;                               Dan Jincks
  21.  ;                             Box 155A HCR 77
  22.  ;                           Annapolis, MO 63620
  23.  ;
  24.  ;
  25.  ;
  26.  ;   You are granted a limited license to use ZOOMBACK.LSP for a 30 day trial
  27.  ;   period.  If you wish to continue using any or all of QUICK COMMAND after
  28.  ;   the trial period, you must become a registered user.  As a registered
  29.  ;   user, you may use QUICK COMMAND on 1 workstation or terminal.
  30.  ;   Additional registrations must be bought for each additional workstation or
  31.  ;   terminal.  To become a registered user, see QC3.DOC
  32.  ;
  33.  ;
  34.  ;   You may send copies of QUICK COMMAND to friends and associates if you abide
  35.  ;   by the following rules:
  36.  ;
  37.  ;   1. It may only be distributed in the original unmodified form.
  38.  ;   2. All original files must be included.
  39.  ;   3. No addition files may be added.
  40.  ;   4. If other files will be on the same disk, QUICK COMMAND files must be in
  41.  ;      a library format such as ".ARC" called "QUICKCMD", or else be put alone
  42.  ;      in a subdirectory called "QUICKCMD".
  43.  ;   5. You may not sell QUICK COMMAND or any part of it.
  44.  ;   6. You are not allowed to charge more then $5 to cover the cost of copying
  45.  ;      and distribution.
  46.  ;   7. You may not distribute any hard copy of the contents of QUICK COMMAND.
  47.  ;
  48.  ;
  49.  ;   These AutoLISP commands and functions are designed to save you time, and
  50.  ;   saving time means saving money.  The registration fee is very modest
  51.  ;   compared to the savings, and much less expensive then typical third party
  52.  ;   AutoCAD software. Be sure to registar if you continue to use them.
  53.  ;
  54.  ;
  55.  ;                                                               DAN
  56.  ;
  57.  ;
  58.  ;
  59.  ;
  60.  ;        AutoCAD and AutoLISP are registered trade marks of Autodesk Inc.
  61.  ;
  62.  ;        ***************************************************************
  63.  ;
  64.  ;   Begin ZOOMBACK.LSP
  65.  ;
  66.  
  67. ;  ZB function
  68.  
  69. (defun C:ZB (/ SCA SCB SCC SCD SCE SCF SCG SCH)
  70.    (setq SCA (getvar "vsmax") SCB (getvar "vsmin"))
  71.    (if (and (> (car SCA)(car SCB))(> (cadr SCA)(cadr SCB)))(progn
  72.       (setq SCG (* (- (car SCA)(car SCB)) 0.001)
  73.             SCH (* (- (cadr SCA)(cadr SCB)) 0.001)
  74.             SCC (- (car SCA) SCG)
  75.             SCD (- (cadr SCA) SCH)
  76.             SCE (+ (car SCB) SCG)
  77.             SCF (+ (cadr SCB) SCH))
  78.    ))
  79.    (if (and (< (car SCA)(car SCB))(> (cadr SCA)(cadr SCB)))(progn
  80.       (setq SCG (* (- (car SCB)(car SCA)) 0.001)
  81.             SCH (* (- (cadr SCA)(cadr SCB)) 0.001)
  82.             SCC (+ (car SCA) SCG)
  83.             SCD (- (cadr SCA) SCH)
  84.             SCE (- (car SCB) SCG)
  85.             SCF (+ (cadr SCB) SCH))
  86.    ))
  87.    (if (and (> (car SCA)(car SCB))(< (cadr SCA)(cadr SCB)))(progn
  88.       (setq SCG (* (- (car SCA)(car SCB)) 0.001)
  89.             SCH (* (- (cadr SCB)(cadr SCA)) 0.001)
  90.             SCC (- (car SCA) SCG)
  91.             SCD (+ (cadr SCA) SCH)
  92.             SCE (+ (car SCB) SCG)
  93.             SCF (- (cadr SCB) SCH))
  94.    ))
  95.    (if (and (< (car SCA)(car SCB))(< (cadr SCA)(cadr SCB)))(progn
  96.       (setq SCG (* (- (car SCB)(car SCA)) 0.001)
  97.             SCH (* (- (cadr SCB)(cadr SCA)) 0.001)
  98.             SCC (+ (car SCA) SCG)
  99.             SCD (+ (cadr SCA) SCH)
  100.             SCE (- (car SCB) SCG)
  101.             SCF (- (cadr SCB) SCH))
  102.    ))
  103.    (if (and SCC SCD SCE SCF)
  104.       (command "ZOOM" "W" (list SCC SCD)(list SCE SCF))
  105.       (prompt " Equal X or Y at corners of screen. Can't zoom.")
  106.    )(princ)
  107. )
  108.  ;
  109.  ;   End ZOOMBACK.LSP
  110.